package com.myspace_1.homeWork;

public class Worker {
    //工人传入工具类的接口调用方法即可
    public void fix(Tools tools){
        System.out.println("工人"+tools.function());
    }

    public static void main(String[] args) {
        //具体需要哪个工具就传入对应的工具类
        new Worker().fix(new Screwdriver());
        new Worker().fix(new Hammer());
    }
}
